package com.wc.alorithm_luogu.P1161;

import java.util.HashSet;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/22 10:49
 * @description https://www.luogu.com.cn/problem/P1161
 * 开灯
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        HashSet<Integer> lights = new HashSet<>();
        double a;
        double t;
        // 从第一盏灯开始
        int index;
        // 开关灯
        int openOrClose;
        while (n-- > 0) {
            index = 1;
            a = sc.nextDouble();
            t = sc.nextInt();
            while (index <= t) {
                openOrClose = (int) (a * index);
                if (lights.contains(openOrClose)) {
                    lights.remove(openOrClose);
                } else {
                    lights.add(openOrClose);
                }
                index++;
            }
        }
        for (Integer light : lights) {
            System.out.println(light);
        }

    }
}
